package com.sion.aspect;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;

/**
 * Aspect for Spring Load Time Weaving.
 * 
 * @author vivo
 * @date 2007-12-24
 */
@Aspect
public class ServiceAspect {

	@Pointcut("execution(* com.sion.DemoService.printABC(..))")
	public void abcPointcut() {
	}

	@Before("com.sion.aspect.ServiceAspect.abcPointcut()")
	public void before() {
		System.out.println("Before service: this is spring aop.");
	}

	//
	// @AfterReturning(pointcut = "abcPointcut()", returning = "returnValue")
	// public void afterReturning(Object returnValue) throws Exception {
	// System.out.println("afterPropertiesSet");
	//
	// }
	//
	// @AfterThrowing(pointcut = "abcPointcut()", throwing = "ex")
	// public void afterThrowing(Throwable ex) throws Exception {
	// System.out.println("afterPropertiesSet");
	// }
	//
	// @After("abcPointcut()")
	// public void after(Throwable ex) throws Exception {
	// System.out.println("afterPropertiesSet");
	// }
	//
	// @Around("abcPointcut()")
	// public void around(ProceedingJoinPoint pjp) throws Exception {
	// try {
	// pjp.proceed();
	// } catch (Throwable e) {
	// e.printStackTrace();
	// }
	// System.out.println("afterPropertiesSet");
	// }

}
